package com.shop.admin.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shop.admin.dao.ChatRoomInferiorDao;
import com.shop.admin.entity.ChatRoomInferior;
import com.shop.admin.service.ChatRoomInferiorService;
import com.shop.admin.socketvo.MessageVo;
import com.shop.admin.utils.PageUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
public class ChatRoomInferiorServiceImpl extends ServiceImpl<ChatRoomInferiorDao, ChatRoomInferior> implements ChatRoomInferiorService {

    @Resource
    private ChatRoomInferiorDao chatRoomInferiorDao;
    @Override
    public PageUtils pageMessage(Map<String, Object> params) {
        Page<MessageVo> page = new Page<>(Long.parseLong(params.get("page").toString()),Long.valueOf(params.get("pageSize").toString()) );
        Page<MessageVo> resPage = chatRoomInferiorDao.pageMessage(page, params);
        PageUtils pageUtils = new PageUtils(resPage);
        return pageUtils;
    }

}
